package com.llpy.mapper;

import com.llpy.dto.SongDto;
import com.llpy.pojo.Singer;
import com.llpy.pojo.Song;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SongMapper extends MongoRepository<Song,String > {
    List<Song> findBySinger(Singer singer);

    List<SongDto> findByName(String name);

    Page<Song> findByNameRegex(String name, Pageable pageable);
    Page<Song> findByRoot(int root,Pageable pageable);

    Page<SongDto> findBySingerNameRegex(String name, Pageable pageable);
}
